    (function($) {
        var creat_html = {
            wrap: function() {
                var toast_wrap_html = '<section class="ui-toast">';
                toast_wrap_html += '<section class="ui-toast-content">';
                return toast_wrap_html;
            },
            icon: function(option) {
                var icon_html =option.icons;
                return icon_html;
            },
            text:function(option){
                var text_html ='<p class="ui-toast-tips">'+option.text+"</p></section></section>";
                return text_html;
            },
        };

        var toast_method = {
            init: function(options) {
                var def = {
                    icons: "",
                    text: "",
                    timeout:'1500'
                };
                var option = $.extend({}, def, options);
                console.log(option);
                return option;
            },
            creat: function(option) {
                var html = creat_html.wrap() + creat_html.icon(option) + creat_html.text(option);
                $('body').append(html);
            },
            show: function(options) {
                var setOption=toast_method.init(options);
                toast_method.creat(setOption);
                toast_method.timeout(setOption);
            },
            hide:function(){
                $(".ui-toast").remove();
            },
            timeout:function(option){
                setTimeout(function(){
                    toast_method.hide();
                },option.timeout)
            }
        };
        jQuery.extend({
            toast_loading:function(options){
                var loading_opt={
                    icons:'<i class="fa fa-spinner fa-pulse fa-fw ui-toast-icon"></i>',
                    text:'加载中。。。'
                };
                var option = $.extend({}, loading_opt, options);
                toast_method.show(option);
            },
            toast_success:function(options){
                var success_opt={
                    icons:'<i class="fa fa-smile-o ui-toast-icon"></i>',
                    text:'操作成功'
                };
                var option = $.extend({}, success_opt, options);
                toast_method.show(option);
            },
            toast_failed:function(options){
                var failed_opt={
                    icons:'<i class="fa fa-frown-o ui-toast-icon"></i>',
                    text:'操作失败'
                };
                var option = $.extend({}, failed_opt, options);
                toast_method.show(option);
            },
            toast_self:function(options){
                toast_method.show(options);
            }
        })
    })(jQuery);
